// index.js

const data = require('../../data/index.js')

Page({
  data: {
    swiperItems: [
      { label: '饮料', value: 'drinks', color: 'blue' },
      { label: '茶', value: 'tea', color: 'red' },
      { label: '酒', value: 'liquor', color: 'green' }
    ],
    foodList: data.foodList
  },
  
  onLoad () {
  },

  goFoodType (event) {
    wx.navigateTo({
      url: `/pages/food-type/food-type?type=${event.currentTarget.dataset.type}`
    })
  },

  goFoodDetail (event) {
    wx.navigateTo({
      url: `/pages/food-detail/food-detail?type=${event.currentTarget.dataset.type}&food=${event.currentTarget.dataset.food}`
    })
  }
})
